<include file="Public/header"/>

		<div id="app">
			<!-- sidebar -->
			<include file="Public/left"/>
			<!-- / sidebar -->
			<div class="app-content">
				<!-- start: TOP NAVBAR -->
				<include file="Public/headernav"/>
				<!-- end: TOP NAVBAR -->
				<div class="main-content" >
					<div class="wrap-content container" id="container">
						<!-- start: PAGE TITLE -->
						<section id="page-title">
							<div class="row">
								<div class="col-sm-8 col-md-offset-4">
									<h1 class="mainTitle">{$msgtitle}</h1>
									<span class="mainDescription">&nbsp;&nbsp;&nbsp;&nbsp;账号信息</span>
								</div>
								
							</div>
						</section>
						<!-- end: PAGE TITLE -->
						<!-- start: YOUR CONTENT HERE -->
<div class="container-fluid container-fullw bg-white">
<form action="" role="form" id="form2" novalidate="novalidate" method="post">
<div class="row">
	<div class="col-md-6 col-md-offset-3">
	<div class="form-group">
		<label class="control-label">
			登录帐号 <span class="symbol required" aria-required="true"></span>
		</label>
		<if condition="$data.id gt 0">
		{$data.account}
		<else/>
		<input type="text" placeholder="填写登录帐号" class="form-control" value="{$data.account}" id="account" name="account">
	    </if>
	</div>
 <if condition="empty($data['id'])">
    <div class="form-group">
		<label>
			 密码
		</label>
		<input type="password" class="form-control" name="newapass" id="newapass">
	</div>
	<div class="form-group">
		<label>
			 重复密码
		</label>
		<input type="password" class="form-control" name="newapass2" id="newapass2">
	</div>
</if>
	<div class="form-group">
		<label class="control-label">
			昵称 <span class="symbol required" aria-required="true"></span>
		</label>
		<input type="text" placeholder="填写昵称" class="form-control" value="{$data.name}" id="name" name="name">
	</div>
    
    <div class="form-group">
		<label class="control-label">
			电话 
		</label>
		<input type="text" placeholder="填写电话" class="form-control" value="{$data.mobile}" id="mobile" name="mobile">
	</div>

	 <div class="form-group">
		<label class="control-label">
			邮箱  
		</label>
		<input type="text" placeholder="填写邮箱" class="form-control" value="{$data.email}" id="email" name="email">
	</div>

    <div class="form-group">
		<label class="control-label">
			帐号类型 <span class="symbol required" aria-required="true"></span>(帐号类型确定后不能修改)
		</label>
		
			<if condition="$data.id gt 0">
			   <if condition="$data.type eq 1">管理员<else/>商家</if>
			<else/>
			   <select class="form-control" id="type" name="type">
			   	<?php if($_SESSION['topadmin'] > 0){ ?> 
			   	<option value="1">管理员</option>
			   	<?php } ?>
	            <option value="0">商家</option>
	           </select>
	       </if>
	</div>
<?php if($_SESSION['topadmin'] > 0){ ?> 	
  <div class="form-group">
		<label class="control-label">
			状态 <span class="symbol required" aria-required="true"></span>
		</label>
		<select class="form-control"   name="status">
			<if condition="$data.id gt 0">
			<option value="1" <if condition="$data.status eq 1">selected</if> >正常</option>
            <option value="0" <if condition="$data.status eq 0">selected</if> >冻结</option>
            <else/>
            <option value="1">正常</option>
            <option value="0">冻结</option>
            </if>
		</select>
	</div>
<?php }else{ ?>
 
<?php if($_SESSION['auid']==$data['id'] && $data['fid']==$_SESSION['auid']){ ?> 	
<div class="form-group">
		<label class="control-label">
			状态 <span class="symbol required" aria-required="true"></span>
		</label>
		{$data['status']?'正常':'冻结'}
	</div>
<?php }else{ ?>

   <div class="form-group">
		<label class="control-label">
			状态 <span class="symbol required" aria-required="true"></span>
		</label>
		<select class="form-control"   name="status">
			<if condition="$data.id gt 0">
			<option value="1" <if condition="$data.status eq 1">selected</if> >正常</option>
            <option value="0" <if condition="$data.status eq 0">selected</if> >冻结</option>
            <else/>
            <option value="1">正常</option>
            <option value="0">冻结</option>
            </if>
		</select>
	</div>
<?php } ?>

<?php } ?>
   <if condition="$_SESSION['topadmin'] gt 0">
		<div class="form-group">
			<label class="control-label">
				权限分组 <span class="symbol required" aria-required="true"></span>
			</label>
			<select class="form-control"   name="group">
				<volist name="grouplist" id='vo'>
				<option value="{$vo.id}" <if condition="$vo.id eq $group_id">selected</if> >{$vo.title}</option>
			    </volist>
			</select>
		</div>
	<else/>
<if condition="$_SESSION['auid'] neq $_SESSION['afid'] && $_SESSION['auid'] != $data['id']">
           
         <div class="form-group">
			<label class="control-label">
				权限分组 <span class="symbol required" aria-required="true"></span>
			</label>
			<select class="form-control"   name="group">
				<volist name="grouplist" id='vo'>
				<option value="{$vo.id}" <if condition="$vo.id eq $group_id">selected</if> >{$vo.title}</option>
			    </volist>
			</select>
		</div>

</if>
	</if>
	
	
</div>
</div>
<div class="row">
<div class="col-md-4 col-md-offset-5">
	<input type="hidden"  value="{$data.id}" name="id">
	<button class="btn btn-primary btn-wide pull-left" type="submit">
		提交 <i class="fa fa-arrow-circle-right"></i>
	</button>
</div>

<div class="col-md-8">
	<p>
		
	</p>
</div>

</div>											
</form>
</div>	


                  





						<!-- end: YOUR CONTENT HERE -->
					</div>
				</div>
			</div>
			<!--  FOOTER and SETTINGS -->
			
           <include file="Public/footer"/>
			<!-- end: FOOTER -->
			<!-- start: OFF-SIDEBAR -->
			
			<!-- end: OFF-SIDEBAR -->
			
		</div>
		<!-- start: MAIN JAVASCRIPTS -->

         <include file="Public/javascript"/>
		
		<!-- end: CLIP-TWO JAVASCRIPTS -->

		<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
		<script src="__PUBLIC__/bootstrap/vendor/ckeditor/ckeditor.js"></script>
		<script src="__PUBLIC__/bootstrap/vendor/ckeditor/adapters/jquery.js"></script>
		<script src="__PUBLIC__/bootstrap/vendor/jquery-validation/jquery.validate.min.js"></script>
		<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY -->
		<!-- start: CLIP-TWO JAVASCRIPTS -->
		<!-- <script src="__PUBLIC__/bootstrap/assets/js/main.js"></script> -->
		<!-- start: JavaScript Event Handlers for this page -->
		<!--<script src="__PUBLIC__/bootstrap/assets/js/form-validation.js"></script>-->
<if condition="$data.id gt 0">
{//编辑}
	<script>

		jQuery(document).ready(function() {
				//FormValidator.init();

	$("#form2").validate({
	  rules: {
	   name: "required",
		  email: "email",
		  mobile: "digits"
	  },

	  messages: {
	   name: "请输入昵称",
		  email:"请输入正确的邮箱格式",
		  mobile: "电话只能是整数"
	  },


	  });
	});
		</script>		
<else/>
{//新增}
	<script>
		// 验证电话号码
//		jQuery.validator.addMethod("mobile", function(value, element) {
//			return this.optional(element) || /^(\(\d{3,4}-)|\d{3.4}-)?\d{7,8}$/.test(value);
//		},"电话号码格式不对");
jQuery(document).ready(function() {
				//FormValidator.init();

	$("#form2").validate({
	  rules: {
		  email: {
			  email:true
		  },
	   account:{
	   	required:true,
	   	remote: {
                        url: "{:U('admin/System/cheack_admin')}",
                        type: "get",
                        dataType: "json",
                        data: {
                            account: function () {
                                return $("#account").val();　　　　//这个是取要验证的密码
                            }
                        },
                        dataFilter: function (msg) {　　　　//判断控制器返回的内容
                            if (msg == "0") {
                                return true;
                            }else {
                                return false;
                            }
                        }
                    }
	   },
	   newapass: {
                    required: true,
                    rangelength: [6, 16]
                },
        newapass2: {
            required: true,
            rangelength: [6, 16],
            equalTo: "#newapass"
        },
	   mobile:{
		   digits: true,
//		   mobile:true

	   },
	   name: "required"
	  },
	  messages: {
	   account: {
	   	required:"请输入帐号",
	   	remote:"该账户已被占用"
	   },
	   newapass: {
                    required: "请填写密码",
                    rangelength: "密码长度在6-12位之间！"
                },
        newapass2: {
            required: "请填写确认密码！",
            rangelength: "密码长度在6-12位之间！",
            equalTo: "两次输入密码不一致！"
        },
		 email:{
			  email:"请输入正确的邮箱格式"
		  },
		mobile: {
			digits: "电话只能是整数"
		},
	   name: "请输入昵称"
	  }
	  });
	});
		</script>
</if>	
		<!-- end: JavaScript Event Handlers for this page -->
	</body>
</html>
